package main.java.com.epam;

import java.util.ArrayList;
import java.util.List;

public class FibonacciNumber {
	
	public static List<Long> findFibonacciNumber(int edgeNumber){
		List<Long> numberList = new ArrayList<Long>();
		numberList.add(0L);
		
		if (edgeNumber < 0 || edgeNumber > 93) throw new RuntimeException("0..93 is permitted");
		if (edgeNumber == 0) return numberList;
		numberList.add(1L);
		if (edgeNumber == 1) return numberList;
		numberList.add(1L);
		
		return findFibonacciNumber(edgeNumber, numberList);		
	}
	
	private static List<Long> findFibonacciNumber(int edgeNumber, List<Long> numberList){
		numberList.add(numberList.get(numberList.size() - 1) + numberList.get(numberList.size() - 2));
		return (numberList.size() == edgeNumber)?numberList:findFibonacciNumber(edgeNumber, numberList);		
	}
	
}
